/**
 * URL encoder class.
 *
 * @author Andrey Anisimov <hercules@inbox.ru>
 */

class Encoder {
	
	/**
	 * Empty instance.
	 */
}

/**
 * Replaces all special URI symbols with its hexadecimal numbers.
 *
 * @param url (string) URL to encode.
 * @return encoded URL.
 */
Encoder.encode = function(url) {
	if (!url) return '';
	url = encodeURI(url);
	url = url.replace(/\+/g, '%2B');
	url = url.replace(/\#/g, '%23');
	url = url.replace(/\?/g, '%3F');
	url = url.replace(/&amp;/g, '%26');
	return url;
}